﻿using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DDMedlem.Buisness;
namespace DDMedlem
{
    public partial class OpdaterMedlem : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Test.Personer == null)
                Test.StartTest();

            var q = from p in Test.Personer select new { Medlemsnr = p.Key, Fornavn = p.Value.fornavn, EfterNavn = p.Value.efternavn, Adresse = p.Value.adresse, Telefon = p.Value.tlf };
            
                    GridView1.DataSource = q.ToList();
            GridView1.DataBind();
            
           

        }

        protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        protected void Edit_Person(object sender, GridViewEditEventArgs  e)
        {
            int uid = Convert.ToInt32(GridView1.Rows[e.NewEditIndex].Cells[1].Text);

            ((DDMController)Session["instance"]).Current_Person = Test.GetPerson(uid);
            Response.Redirect("RegistrerMedlem.aspx");
        }

        

       

       
    }
}